package com.qingchi.web.controller.social;

import com.socialuni.social.api.CommentApi;
import com.socialuni.social.model.QO.comment.CommentDeleteVO;
import com.socialuni.social.model.QO.comment.OpenCommentAddVO;
import com.socialuni.social.model.RO.comment.CommentTalkVO;
import com.socialuni.social.model.common.ResultRO;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.io.IOException;

@RestController
public class CommentController implements CommentApi {
    @Resource
    CommentApi commentApi;

    @Override
    public ResultRO<CommentTalkVO> addComment(@RequestBody @Valid @NotNull OpenCommentAddVO commentVO) throws IOException {
        return commentApi.addComment(commentVO);
    }

    @Override
    public ResultRO<Object> deleteComment(@RequestBody @Valid @NotNull CommentDeleteVO commentVO) {
        return commentApi.deleteComment(commentVO);
    }
}